<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="/common/include/page.jsp" %>
<jsp:useBean id="answer" class="com.carlinfo.userscenter.stu.pojo.Answer"></jsp:useBean>
<!DOCTYPE HTML>
<html>
	<head>
		<title>新增文章 - 朝代管理 </title>
		<%@ include file="/common/include/title.jsp" %>
		<script type="text/javascript" src="${rootPath }/common/resource/H-ui.admin/lib/ueditor/1.4.3/ueditor.config.js"></script> 
		<script type="text/javascript" src="${rootPath }/common/resource/H-ui.admin/lib/ueditor/1.4.3/ueditor.all.min.js"> </script> 
		<script type="text/javascript" src="${rootPath }/common/resource/H-ui.admin/lib/ueditor/1.4.3/lang/zh-cn/zh-cn.js"></script>
		<meta name="keywords" content="H-ui.admin v3.1,H-ui网站后台模版,后台模版下载,后台管理系统模版,HTML后台模版下载">
		<meta name="description" content="H-ui.admin v3.1，是一款由国人开发的轻量级扁平化网站后台模板，完全免费开源的网站后台管理系统模版，适合中小型CMS后台系统。">
	</head>
	<body>
	<h4 style="text-align: center;">${requestScope.json.info}</h4>
	<article class="page-container">
		<form class="form form-horizontal" id="form-article-add" 
		action="${rootPath }/back/AnswerBackServlet?method=answerUpdateSubmit" method="post">
			<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>问题：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" autocomplete="off" readonly="readonly" value="${requestScope.answer.question.name }" placeholder="" id="trueName" name="trueName">
			</div>
			</div>
		<input type="hidden" name="id" value="${requestScope.answer.id}">
			<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>学生：</label>
				<div class="formControls col-xs-8 col-sm-9">
					<input type="text" class="input-text" autocomplete="off" readonly="readonly" value="${requestScope.answer.students.name }" placeholder="" id="trueName" name="trueName">
				</div>
			</div>
			<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>答案：</label>
				<div class="formControls col-xs-8 col-sm-9">
				<textarea name="jieGuo" id="jieGuo" cols=""  rows="" class="textarea" value=""  placeholder="${requestScope.answer.jieGuo}" dragonfly="true" onKeyUp="$.Huitextarealength(this,100)">${requestScope.answer.jieGuo}</textarea>
						<p class="textarea-numberbar"><em class="textarea-length">0</em>/100</p>
				</div>
			</div>
		
			<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>状态：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<c:forEach items="${answer.statusMap }" var="enumMap" varStatus="stat">
					<label for="status${enumMap.value.value}">
						<input type="radio" name="status" placeholder="" value="${enumMap.value.value }" 
						${enumMap.value.value==1? 'checked':'' } id="status${enumMap.value.value}">${enumMap.value.info }
					</label>
				</c:forEach>
			</div>
			</div>
		
			<div class="row cl">
					<label class="form-label col-xs-4 col-sm-3"><span
						class="c-red">*</span>对错：</label>
				<div class="formControls col-xs-8 col-sm-9">
						<label for="status0">
							<!-- 目前:状态应该是数据库里面选中的效果 -->
							<input type="radio" value="0" placeholder=""
							id="status0" name="shiFou">错误
					</label>
					<label for="status1">
							<!-- 目前:状态应该是数据库里面选中的效果 -->
							<input type="radio" value="1" placeholder=""
							checked="checked"
							id="status1" name="shiFou">正确
					</label>
				</div>
			</div>
			
			<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"></label>
				<div class="formControls col-xs-8 col-sm-9">
				<button onClick="article_save_submit();" class="btn btn-primary radius" type="submit"><i class="Hui-iconfont">&#xe632;</i> 保存并提交审核</button>
					<button onClick="removeIframe();" class="btn btn-default radius" type="button">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>
				</div>
			</div>
			
			<!-- <div class="row cl">
				<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
					<button onClick="article_save_submit();" class="btn btn-primary radius" type="submit"><i class="Hui-iconfont">&#xe632;</i> 保存并提交审核</button>
					<button onClick="removeIframe();" class="btn btn-default radius" type="button">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>
				</div>
			</div> -->
		</form>
	</article>
	
	<!--请在下方写此页面业务相关的脚本-->
	<script type="text/javascript">
	$(function(){
		$('.skin-minimal input').iCheck({
			checkboxClass: 'icheckbox-blue',
			radioClass: 'iradio-blue',
			increaseArea: '20%'
		});
		
		//表单验证
		$("#form-article-add").validate({
			rules:{
				articletitle:{
					required:true,
				},
				articletitle2:{
					required:true,
				},
				articlecolumn:{
					required:true,
				},
				articletype:{
					required:true,
				},
				articlesort:{
					required:true,
				},
				keywords:{
					required:true,
				},
				abstract:{
					required:true,
				},
				author:{
					required:true,
				},
				sources:{
					required:true,
				},
				allowcomments:{
					required:true,
				},
				commentdatemin:{
					required:true,
				},
				commentdatemax:{
					required:true,
				},
	
			},
			onkeyup:false,
			focusCleanup:true,
			success:"valid",
			submitHandler:function(form){
				//$(form).ajaxSubmit();
				var index = parent.layer.getFrameIndex(window.name);
				//parent.$('.btn-refresh').click();
				parent.layer.close(index);
			}
		});	
		var ue = UE.getEditor('editor');
		
	});
	</script>
	<!--/请在上方写此页面业务相关的脚本-->
	</body>
</html>